subject', lang('thread_contain_sensitive_word') . $qt_error); qt_check_sensitive_word($message, 'post_sensitive_words', $qt_error) AND message('message', lang('post_contain_sensitive_word') . $qt_error);include_once APP_PATH.'plugin/xn_geetest/model/geetest.fuc.php'; geetestcheck('geetest_edit_on'); empty($message) AND message('message', lang('please_input_message')); mb_strlen($message, 'UTF-8') > 2048000 AND message('message', lang('message_too_long')); $arr = array(); if($isfirst) { $newfid = param('fid'); $forum = forum_read($newfid); empty($forum) AND message('fid', lang('forum_not_exists')); if($fid != $newfid) { !forum_access_user($fid, $gid, 'allowthread') AND message(-1, lang('user_group_insufficient_privilege')); $post['uid'] != $uid AND !forum_access_mod($fid, $gid, 'allowupdate') AND message(-1, lang('user_group_insufficient_privilege')); $arr['fid'] = $newfid; } if($subject != $thread['subject']) { mb_strlen($subject, 'UTF-8') > 80 AND message('subject', lang('subject_max_length', array('max'=>80))); $arr['subject'] = $subject; } $arr AND thread_update($tid, $arr) === FALSE AND message(-1, lang('update_thread_failed')); } $r = post_update($pid, array('doctype'=>$doctype, 'message'=>$message)); $r === FALSE AND message(-1, lang('update_post_failed')); $thread_keywords = param('thread_keywords'); $thread_description = param('thread_description'); db_update('thread', array('tid' => $tid), array('thread_keywords' => $thread_keywords,'thread_description' => $thread_description)); global $group; if($isfirst) { $new_fid = param('fid'); $check_result = check_or_not($group, $new_fid, 'thread'); if($check_result)check_set_thread_check($tid,'0'); } else { $check_result = check_or_not($group, $fid, 'thread'); if($check_result)check_set_post_check($pid,'0'); } if($group['allowsell']=="1") { $content_num_status = param('content_num_status'); $content_num = param('content_num');//下面添加 if($content_num < 0 ){//判断购买主题货币值小于零 $content_num = 1;//小于零强制写为一 } $content_type = credits_get_content_type_by_name(param('content_type')); if ($content_num_status && $content_num) db_update('thread', array('tid' => $tid), array('content_buy' => $content_num, 'content_buy_type' => $content_type)); else db_update('thread', array('tid' => $tid), array('content_buy' => 0)); } $pnumber = param('readp'); $pstatus=param('readp_status'); if ($pstatus && $pnumber>=0) db_update('thread', array('tid' => $tid), array('readp' => $pnumber)); else db_update('thread', array('tid' => $tid), array('readp' => 0)); message(0, lang('update_successfully')); //message(0, array('pid'=>$pid, 'subject'=>$subject, 'message'=>$message)); } } elseif($action == 'delete') { $pid = param(2, 0); if($gid != 1) message(-1, '没有权限删除帖子,请联系管理员'); if($method != 'POST') message(-1, lang('method_error')); $post = post_read($pid); empty($post) AND message(-1, lang('post_not_exists')); $tid = $post['tid']; $thread = thread_read($tid); empty($thread) AND message(-1, lang('thread_not_exists')); $fid = $thread['fid']; $forum = forum_read($fid); empty($forum) AND message(-1, lang('forum_not_exists')); $isfirst = $post['isfirst']; !forum_access_user($fid, $gid, 'allowpost') AND message(-1, lang('user_group_insufficient_privilege')); $allowdelete = forum_access_mod($fid, $gid, 'allowdelete'); !$allowdelete AND !$post['allowdelete'] AND message(-1, lang('insufficient_delete_privilege')); !$allowdelete AND $thread['closed'] AND message(-1, lang('thread_has_already_closed')); $set_check = setting_get('tt_check'); if($set_check['recycle']=='1'){ if($isfirst) { if($thread['OK']=='-2' && $group['see_check']) thread_delete($tid); else recycle_thread_delete($tid); } else { post_delete($pid); //post_list_cache_delete($tid); } } else { if($isfirst) { thread_delete($tid); } else { post_delete($pid); //post_list_cache_delete($tid); } } message(0, lang('delete_successfully')); } elseif ($action == 'post_like') { $header['title'] = lang('haya_post_like')." - " . $conf['sitename']; if (!$uid) { message(0, lang('haya_post_like_login_like_tip')); } if ($method == 'POST') { $pid = param('pid'); $post = post_read($pid); empty($post) AND message(0, lang('post_not_exists')); if ($post['isfirst'] == 1) { if (isset($haya_post_like_config['open_thread']) && $haya_post_like_config['open_thread'] != 1 ) { message(0, lang('haya_post_like_close_thread_tip')); } } else { if (isset($haya_post_like_config['open_post']) && $haya_post_like_config['open_post'] != 1 ) { message(0, lang('haya_post_like_close_post_tip')); } } $haya_post_like_check = haya_post_like_find_by_uid_and_pid($uid, $pid); $action2 = param(2, 'create'); if ($action2 == 'create') { if (!empty($haya_post_like_check)) { message(0, lang('haya_post_like_user_has_like_tip')); } haya_post_like_create(array( 'tid' => $post['tid'], 'pid' => $pid, 'uid' => $user['uid'], 'create_date' => time(), 'create_ip' => $longip, )); haya_post_like_loves($pid, 1); if (function_exists("notice_send")) { if ($post['isfirst'] == 1) { $thread = thread_read($post['tid']); $thread['subject'] = notice_substr($thread['subject'], 20); $notice_thread = '【'.$thread['subject'].'】'; $notice_user = ' '.$user['username'].''; $notice_msg = str_replace( array('{thread}', '{user}'), array($notice_thread, $notice_user), lang('haya_post_like_send_notice_for_thread') ); notice_send($user['uid'], $post['uid'], $notice_msg, 150); } else { $post['message'] = htmlspecialchars(strip_tags($post['message'])); $post['message'] = notice_substr($post['message'], 20); $notice_post = '【'.$post['message'].'】'; $notice_user = ' '.$user['username'].''; $notice_msg = str_replace( array('{post}', '{user}'), array($notice_post, $notice_user), lang('haya_post_like_send_notice_for_post') ); notice_send($user['uid'], $post['uid'], $notice_msg, 150); } } $haya_post_like_count = haya_post_like_count(array('pid' => $pid)); $haya_post_like_msg = array( 'count' => intval($haya_post_like_count), 'msg' => lang('haya_post_like_like_success_tip'), ); message(1, $haya_post_like_msg); } elseif ($action2 == 'delete') { if (isset($haya_post_like_config['like_is_delete']) && $haya_post_like_config['like_is_delete'] != 1 ) { message(0, lang('haya_post_like_no_unlike_tip')); } if (empty($haya_post_like_check)) { message(0, lang('haya_post_like_user_no_like_tip')); } $post_like = haya_post_like_read_by_uid_and_pid($uid, $pid); $delete_time = intval($haya_post_like_config['delete_time']); if ($post_like['create_date'] + $delete_time > time()) { message(0, lang('haya_post_like_no_fast_like_tip')); } haya_post_like_delete_by_pid_and_uid($pid, $user['uid']); haya_post_like_loves($pid, -1); $haya_post_like_count = haya_post_like_count(array('pid' => $pid)); $haya_post_like_msg = array( 'count' => intval($haya_post_like_count), 'msg' => lang('haya_post_like_unlike_success_tip'), ); message(1, $haya_post_like_msg); } message(1, lang('haya_post_like_like_error_tip')); } message(1, lang('haya_post_like_like_error_tip')); } elseif($action=='check' && $method=='POST'){ $opt = param('opt');//1:OK -1:NO -2:DELETE $data = param('data'); $act = param('act'); if(!$uid){message(-1,'拉取信息失败!');die();} if($group['see_check']!=1){message(-1,'无权操作!');die();} if($act=='0') check_set_thread_check($data,$opt); elseif($act=='1') check_set_post_check($data,$opt); elseif($act=='2') check_set_user_check($data,$opt); message(0,'审核完毕!'); } elseif($action=='recycle' &&$method=='POST') { $set_recycle = setting_get('tt_check'); if($set_recycle['recycle']!='1') {message(-1,'未开启回收站功能!');die();} if($group['see_check']!='1') {message(-1,'无权操作回收站功能!');die();} $opt=param('opt'); $data=param('data'); //-1:recovery 1:delete if($opt=='-1') recycle_thread_recovery($data); elseif($opt=='1') recycle_thread_delete_true($data); message(0,'操作完毕!'); } ?>